import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './assets/css/preset.scss'
import {
  Form,FormItem,Input,Button,Row,Message,Container,Header,Aside,
  Main,Col,Menu,Submenu,MenuItemGroup,MenuItem,Breadcrumb,BreadcrumbItem,
  Card,Table,TableColumn,Switch,Tooltip,Pagination,Dialog,MessageBox,
  Tag,Tree,Select,Option
} from 'element-ui'
import axios from 'axios'

Vue.use(Form)

Vue.use(Input)
Vue.use(FormItem)
Vue.use(Button)
Vue.use(Row)
Vue.use(Container)
Vue.use(Header)
Vue.use(Aside)
Vue.use(Main)

Vue.use(Col)
Vue.use(Menu)
Vue.use(Submenu)
Vue.use(MenuItemGroup)
Vue.use(MenuItem)
Vue.use(Breadcrumb)
Vue.use(BreadcrumbItem)
Vue.use(Card)
Vue.use(Table)
Vue.use(TableColumn)
Vue.use(Switch)
Vue.use(Tooltip)
Vue.use(Pagination)
Vue.use(Dialog)
Vue.use(Tag)
Vue.use(Tree)
Vue.use(Select)
Vue.use(Option)
axios.defaults.baseURL  = 'http://timemeetyou.com:8889/api/private/v1/'
//*每次api请求都经过这边，预处理下请求头
axios.interceptors.request.use(config=>{
  config.headers.Authorization = window.sessionStorage.getItem('token');
  //*一定要放行返回config
  return config
})
Vue.prototype.$http=axios;
Vue.prototype.$message=Message;
Vue.prototype.$confirm=MessageBox.confirm;

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
